<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>数据统计</title>
	<!-- Tell the browser to be responsive to screen width -->
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<!-- Bootstrap 3.3.7 -->
	<link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.min.css">
	<!-- Font Awesome -->
	<link rel="stylesheet" href="../bower_components/font-awesome/css/font-awesome.min.css">
	<!-- Ionicons -->
	<link rel="stylesheet" href="../bower_components/Ionicons/css/ionicons.min.css">
	<!-- Theme style -->
	<link rel="stylesheet" href="../dist/css/AdminLTE.min.css">
	<!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
	<link rel="stylesheet" href="../dist/css/skins/_all-skins.min.css">
	<!-- Morris chart -->
	<link rel="stylesheet" href="../bower_components/morris.js/morris.css">
	<!-- jvectormap -->
	<link rel="stylesheet" href="../bower_components/jvectormap/jquery-jvectormap.css">
	<!-- Date Picker -->
	<link rel="stylesheet" href="../bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
	<!-- Daterange picker -->
	<link rel="stylesheet" href="../bower_components/bootstrap-daterangepicker/daterangepicker.css">
	<!-- bootstrap wysihtml5 - text editor -->
	<link rel="stylesheet" href="../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

	<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
	<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
	<![endif]-->

	<!-- Google Font -->
	<link rel="stylesheet"
		  href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
	<header class="main-header">
		<!-- Logo -->
		<a href="#" class="logo">
			<span class="logo-mini"><b>A</b>P</span>
			<span class="logo-lg"><b>Admin</b>Page</span>
		</a>
		<nav class="navbar navbar-static-top">
			<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</a>

			<div class="navbar-custom-menu">
				<ul class="nav navbar-nav">
					<!-- Notifications: style can be found in dropdown.less -->
					<li class="dropdown notifications-menu">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">
							<i class="fa fa-bell-o"></i>
							<span class="label label-warning" id="warning"
								  th:text="${session.warningMerches.size()}"></span>
						</a>
						<ul class="dropdown-menu ">
							<li class="header" th:text="${session.warningMerches.size()}+'条商品库存数量达到警戒线'"></li>
							<li>
								<!-- inner menu: contains the actual data -->
								<ul class="menu" th:each="m:${session.warningMerches}">
									<li>
										<a href="#">
											<i class="fa fa-warning text-yellow"></i>
											<span th:text="${m.getMerchName()}"></span>
										</a>
									</li>
								</ul>
							</li>
							<li class="footer"><a href="#">View all</a></li>
						</ul>
					</li>

					<!-- User Account: style can be found in dropdown.less -->
					<li class="dropdown user user-menu">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">
							<span class="hidden-xs">Admin</span>
						</a>
					</li>
				</ul>
			</div>
		</nav>
	</header>
	<!-- Left side column. contains the logo and sidebar -->
	<aside class="main-sidebar">
		<!-- sidebar: style can be found in sidebar.less -->
		<section class="sidebar">
			<!-- sidebar menu: : style can be found in sidebar.less -->
			<ul class="sidebar-menu" data-widget="tree">
				<li class="header">MAIN NAVIGATION</li>
				<li>
					<a href="/">
						<i class="fa fa-pie-chart"></i> <span>数据统计</span>
					</a>
				</li>
				<li class="treeview">
					<a href="#">
						<i class="glyphicon glyphicon-gift"></i> <span>商品管理</span>
						<span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
					</a>
					<ul class="treeview-menu">
						<li><a href="/merch/listMerch"><i class="fa fa-circle-o"></i>商品列表</a></li>
						<li><a href="/merch/addMerch"><i class="fa fa-circle-o"></i>添加商品</a></li>
					</ul>
				</li>

				<li class="treeview">
					<a href="#">
						<i class="glyphicon glyphicon-send"></i>
						<span>供应商管理</span>
						<span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
					</a>
					<ul class="treeview-menu">
						<li><a href="/provider/list"><i class="fa fa-circle-o"></i>供应商列表</a></li>
						<li><a href="/provider/addProvider"><i class="fa fa-circle-o"></i>添加供应商</a></li>
					</ul>
				</li>
				<li class="treeview">
					<a href="#">
						<i class="fa fa-laptop"></i>
						<span>入库管理</span>
						<span class="pull-right-container">
                            <i class="fa fa-angle-left pull-right"></i>
                        </span>
					</a>
					<ul class="treeview-menu">
						<li><a href="/instock/list"><i class="fa fa-circle-o"></i>入库记录</a></li>
						<li><a href="/instock/add"><i class="fa fa-circle-o"></i>添加记录</a></li>
					</ul>
				</li>
				<li class="treeview active">
					<a href="#">
						<i class="glyphicon glyphicon-shopping-cart"></i> <span>销售管理</span>
						<span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
					</a>
					<ul class="treeview-menu">
						<li><a href="/sale/getAll"><i class="fa fa-circle-o"></i>订单列表</a></li>
						<li class="active"><a href="/sale/adds"><i class="fa fa-circle-o"></i>添加订单</a></li>
					</ul>
				</li>
				<li class="treeview">
					<a href="#">
						<i class="glyphicon glyphicon-user"></i> <span>会员管理</span>
						<span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
					</a>
					<ul class="treeview-menu">
						<li><a href="/member/list"><i class="fa fa-circle-o"></i>会员列表</a></li>
						<li><a href="/member/add"><i class="fa fa-circle-o"></i>添加会员</a></li>
					</ul>
				</li>
				<li class="treeview">
					<a href="#">
						<i class="fa fa-calendar"></i> <span>员工管理</span>
						<span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
					</a>
					<ul class="treeview-menu">
						<li><a href="/staff/listStaff"><i class="fa fa-circle-o"></i>员工列表</a></li>
						<li><a href="/staff/addStaff"><i class="fa fa-circle-o"></i>添加员工</a></li>
					</ul>
				</li>
			</ul>
		</section>
		<!-- /.sidebar -->
	</aside>

		<!-- Content Wrapper. Contains page content -->
		<div class="content-wrapper">
			<!-- Content Header (Page header) -->
			<section class="content-header">
				<h1>
					添加订单
				</h1>

			</section>

			<!-- Main content -->

			<section class="content">




				<div class="box">
					<div class="box-header with-border">
						<h3 class="box-title">添加订单</h3>

						<div class="box-tools pull-right">
							<button type="button" class="btn btn-box-tool"
								data-widget="collapse" data-toggle="tooltip" title="Collapse">
								<i class="fa fa-minus"></i>
							</button>
							<button type="button" class="btn btn-box-tool"
								data-widget="remove" data-toggle="tooltip" title="Remove">
								<i class="fa fa-times"></i>
							</button>
						</div>
					</div>

					<div class="box-body">
						<div class="col-md-6">
							<!-- general form elements -->
							<div class="box box-primary">
								<!-- /.box-header -->
								<div class="box-header with-border">
									<h3 class="box-title">新订单：</h3>
								</div>
								<!-- form start -->
								<form role="form" id="addForm">
									<div class="box-body">
										<div class="form-group">
											<label for="userId">客户ID：</label> <input
												class="form-control" id="userId" name="userId" type="text"
												placeholder="必填" />
										</div>
										<div class="form-group">
											<label for="merchId">商品ID：</label> <input
												class="form-control" id="merchId" name="merchId" type="text"
												placeholder="必填" />
										</div>
										<div class="form-group">
											<label for="merchNumber">商品数量：</label> <input
												class="form-control" id="merchNumber" name="merchNumber"
												type="text" placeholder="必填" />
										</div>
										<div class="form-group">
											<label for="salePrice">总价：</label> <input
												class="form-control" id="salePrice" name="salePrice"
												type="text" placeholder="必填" />
										</div>

									</div>
									<!-- /.box-body -->

									<div class="box-footer">
										<button type="button" id="addSale" class="btn btn-primary">添加订单</button>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
				<!-- /.box -->
			</section>
			<!-- /.content -->
		</div>
		<!-- /.content-wrapper -->

	</div>
	<!-- ./wrapper -->

	<!-- jQuery 3 -->
	<script src="../../bower_components/jquery/dist/jquery.min.js"></script>
	<!-- Bootstrap 3.3.7 -->
	<script src="../../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
	<!-- DataTables -->
	<script
		src="../../bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
	<script
		src="../../bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
	<!-- SlimScroll -->
	<script
		src="../../bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
	<!-- FastClick -->
	<script src="../../bower_components/fastclick/lib/fastclick.js"></script>
	<!-- AdminLTE App -->
	<script src="../../dist/js/adminlte.min.js"></script>
	<!-- AdminLTE for demo purposes -->
	<script src="../../dist/js/demo.js"></script>
	<!-- page script -->

	<script type="text/javascript">
		$("#addSale").click(function() {
			var userId = $('#userId').val();
			var merchId = $('#merchId').val();
			var merchNumber = $('#merchNumber').val();
			var salePrice = $('#salePrice').val();
			var obj = new Object();
			obj.userId = userId;
			obj.merchId = merchId;
			obj.merchNumber = merchNumber;
			obj.salePrice = salePrice;
			var data = JSON.stringify(obj);
			$.ajax({
				url : "/sale/addlaji",
				contentType : 'application/json',
				dataType : "json",
				type : "post",
				data : data,
				success : function(data) {
					alert(data.msg);
					window.location.reload();
				},
				error : function(data) {
					alert("error");
				}
			});
		})
	</script>
</body>

</html>